package com.kefu.call.vo;

import javax.persistence.Id;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;

import com.kefu.call.model.ActivityUserInfo;
import com.kefu.common.context.KefuContext;
import com.kefu.common.vo.AbstractUpdateVo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * @author francis
 * @date 2021/05/22
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel(description = "活动用户")
public class ActivityUserInfoUpdateVo extends AbstractUpdateVo<ActivityUserInfo,String> {

    
	@NotEmpty
    @ApiModelProperty(value = "主键")
    private String activityUserId;
    @Size(max = 32)
    @ApiModelProperty(value = "活动Id")
    private String activityId;
    @ApiModelProperty(value = "数据状态0 无效，1有效")
    private Integer dataStatus;
    @Size(max = 32)
    @ApiModelProperty(value = "用户ID")
    private String userId;
    @Size(max = 32)
    @ApiModelProperty(value = "用户姓名")
    private String userName;

    @Override
    public ActivityUserInfo convert() {
        ActivityUserInfo info = new ActivityUserInfo();
        info.setActivityId(activityId);
        info.setDataStatus(dataStatus);
        info.setUserId(userId);
        info.setUserName(userName);
        KefuContext context = KefuContext.getKefuContext();
        info.setActivityUserId(activityUserId);
        info.setUpdateTime(context.getNow());
        info.setUpdateUser(context.getUserId());
        return info;
	}
}